<!DOCTYPE html>
<!-- saved from url=(0076)../../../zh-cn/latest/contracts/voken.html#understand-voken-contract -->
<html class=" js flexbox canvas canvastext webgl no-touch geolocation postmessage websqldatabase indexeddb hashchange history draganddrop websockets rgba hsla multiplebgs backgroundsize borderimage borderradius boxshadow textshadow opacity cssanimations csscolumns cssgradients cssreflections csstransforms csstransforms3d csstransitions fontface generatedcontent video audio localstorage sessionstorage webworkers applicationcache svg inlinesvg smil svgclippaths" lang="zh-CN" style=""><!--<![endif]--><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  
  
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  
  <title>KID 主合约 — KID.network latest 文档</title>
  

  
  
  
  

  
  <script async="" src="all/analytics.js.下载"></script><script type="text/javascript" src="all/modernizr.min.js.下载"></script>
  
    
      <script type="text/javascript" id="documentation_options" data-url_root="../" src="all/documentation_options.js.下载"></script>
        <script type="text/javascript" src="all/jquery.js.下载"></script>
        <script type="text/javascript" src="all/underscore.js.下载"></script>
        <script type="text/javascript" src="all/doctools.js.下载"></script>
        <script type="text/javascript" src="all/language_data.js.下载"></script>
        <script type="text/javascript" src="all/translations.js.下载"></script>
        <script type="text/javascript" src="all/readthedocs-doc-embed.js.下载"></script>
    
    <script type="text/javascript" src="all/theme.js.下载"></script>

    

  
  <link rel="stylesheet" href="all/theme.css" type="text/css">
  <link rel="stylesheet" href="all/pygments.css" type="text/css">
    <link rel="index" title="索引" href="../../../zh-cn/latest/genindex.html">
    <link rel="search" title="搜索" href="../../../zh-cn/latest/search.html">
    <link rel="next" title="KID 公开销售合约" href="../../../zh-cn/latest/contracts/voken_sale.html">
    <link rel="prev" title="基础原则" href="../../../zh-cn/latest/views/basic_principles.html"> 

<!-- RTD Extra Head -->

<!-- 
Always link to the latest version, as canonical.
http://docs.readthedocs.org/en/latest/canonical.html
-->
<link rel="canonical" href="../../../zh-cn/latest/contracts/voken.html">

<link rel="stylesheet" href="all/readthedocs-doc-embed.css" type="text/css">

<script type="text/javascript" src="all/readthedocs-data.js.下载"></script>

<!-- Add page-specific data, which must exist in the page js, not global -->
<script type="text/javascript">
READTHEDOCS_DATA['page'] = "contracts/voken"
READTHEDOCS_DATA['source_suffix'] = ".rst"
</script>

<script type="text/javascript" src="all/readthedocs-analytics.js.下载"></script>

<!-- end RTD <extrahead> -->
</head>

<body class="wy-body-for-nav">

   
  <div class="wy-grid-for-nav">
    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search">
          

          
            <a href="../../../zh-cn/latest/index.html" class="icon icon-home"> KID.network
          

          
          </a>

          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../../../zh-cn/latest/search.html" method="get">
    <input type="text" name="q" placeholder="Search docs">
    <input type="hidden" name="check_keywords" value="yes">
    <input type="hidden" name="area" value="default">
  </form>
</div>

          
        </div>

        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <p class="caption"><span class="caption-text">最新消息</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../zh-cn/latest/reports/season_top_sales.html">赛季销售排名奖励</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../zh-cn/latest/news/voken_contract_upgraded.html">KID 主合约升级完毕</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../zh-cn/latest/reports/summary2019.html">2019 项目进展</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../zh-cn/latest/reports/summary2018.html">2018 年度简要总结</a></li>
</ul>
<p class="caption"><span class="caption-text">KID 流量币</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../zh-cn/latest/letters/as_an_investor.html">投资者需知</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../zh-cn/latest/token/sale.html">KID 公开销售（5月27日启动）</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../zh-cn/latest/policy/voken_referral_program.html">KID 转介引荐计划</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../zh-cn/latest/token/airdrop_via_contract.html">KID 合约空投（暂时关闭）</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../zh-cn/latest/token/airdrop_to_eth_holders.html">向 ETH 持有者空投</a></li>
</ul>
<p class="caption"><span class="caption-text">当前可用服务</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../zh-cn/latest/reports/vnvpn_alpha.html">vnVPN Alpha 内测版</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../zh-cn/latest/services/autossr.html">AutoSSR：免费 ShadowsocksR 服务</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../zh-cn/latest/guide/shadowrocket.html">如何在苹果手机上免费使用 AutoSSR ？</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../zh-cn/latest/guide/ssrr.html">如何在安卓手机上免费使用 AutoSSR ？</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../zh-cn/latest/guide/shadowsocksr_win.html">如何在 windows 电脑上免费使用 AutoSSR ？</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../zh-cn/latest/guide/shadowsocksr_mac.html">如何在苹果电脑上免费使用 AutoSSR ？</a></li>

</ul>
<p class="caption"><span class="caption-text">使用与操作指导</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../zh-cn/latest/guide/voken_sale.html">如何参与 KID 公开销售？</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../zh-cn/latest/guide/register_voken_sale_whitelist.html">如何注册 KID 公开销售白名单？</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../zh-cn/latest/guide/read_voken_sale_contract.html">如何查看 KID 公开销售合约数据？</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../zh-cn/latest/guide/batch_transfer.html">如何批量转账 ETH 和 KID ？</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../zh-cn/latest/guide/imtoken.html">手机端以太坊钱包： imToken</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../zh-cn/latest/guide/metamask.html">PC 端以太坊钱包： MetaMask</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../zh-cn/latest/guide/shadowrocket.html">如何在苹果手机上免费使用 AutoSSR ？</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../zh-cn/latest/guide/ssrr.html">如何在安卓手机上免费使用 AutoSSR ？</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../zh-cn/latest/guide/shadowsocksr_win.html">如何在 windows 电脑上免费使用 AutoSSR ？</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../zh-cn/latest/guide/shadowsocksr_mac.html">如何在苹果电脑上免费使用 AutoSSR ？</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../zh-cn/latest/guide/eth_wallet.html">如何使用以太坊钱包？</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../zh-cn/latest/guide/gas.html">如何设置 <code class="docutils literal notranslate"><span class="pre">gas</span> <span class="pre">limit</span></code> 和 <code class="docutils literal notranslate"><span class="pre">gas</span> <span class="pre">price</span></code> ？</a></li>
</ul>
<p class="caption"><span class="caption-text">推荐阅读与观点集</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../zh-cn/latest/views/voken_pricing.html">KID 的价格逻辑和早期机会</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../zh-cn/latest/views/internet_in_china.html">关于中国的互联网</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../zh-cn/latest/views/basic_principles.html">基础原则</a></li>
</ul>
<p class="caption"><span class="caption-text">以太坊智能合约</span></p>
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal" href="../../../zh-cn/latest/contracts/voken.html#"><span class="toctree-expand"></span>KID 主合约</a><ul>
<li class="toctree-l2 current"><a class="reference internal current" href="../../../zh-cn/latest/contracts/voken.html#understand-voken-contract"><span class="toctree-expand"></span>读懂 KID 合约</a><ul>
<li class="toctree-l3"><a class="reference internal" href="../../../zh-cn/latest/contracts/voken.html#meta">元信息</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../zh-cn/latest/contracts/voken.html#voken-sale-whitelist-registration-trigger">KID 销售白名单注册触发</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../zh-cn/latest/contracts/voken.html#voken-sale-whitelist-registration-and-referral-reward">KID 销售白名单注册与转介奖励</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../zh-cn/latest/contracts/voken.html#check-whether-a-eth-wallet-address-is-whitelisted">查看一个 ETH 钱包地址是否在白名单中</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../zh-cn/latest/contracts/voken.html#check-whether-the-voken-sale-whitelist-registration-is-in-process">查看 KID 销售白名单注册是否还在进行中</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../zh-cn/latest/contracts/voken.html#whitelist-qualification-transfer-is-supported">白名单资格支持过户</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../../zh-cn/latest/contracts/voken_sale.html">KID 公开销售合约</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../zh-cn/latest/contracts/airdrop.html">KID 空投合约</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../zh-cn/latest/contracts/airdrop_to_eth_holders.html">向 ETH 持有者空投的合约</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../zh-cn/latest/contracts/business_fund.html">商业拓展基金持币合约</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../zh-cn/latest/contracts/developers_fund.html">应用开发者基金持币合约</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../zh-cn/latest/contracts/service_nodes_fund.html">服务节点激励持币合约</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../zh-cn/latest/contracts/early_investors_fund.html">早期投资人持币合约</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../zh-cn/latest/contracts/team_fund.html">团队基金</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../zh-cn/latest/contracts/voken_migration.html">KID 迁移合约</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../zh-cn/latest/contracts/get_1002voken.html">获取 1,002.0 KIDs 的合约</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../zh-cn/latest/contracts/batch_transfer.html">批量转账 ETH 和 KID 合约</a></li>
</ul>
<p class="caption"><span class="caption-text">共建</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../zh-cn/latest/contributing/contribute.html">参与远景网络共建</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../zh-cn/latest/contributing/v5.html">V5 社区联盟</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../zh-cn/latest/contributing/ex_plan.html">交易所白名单计划</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../zh-cn/latest/contributing/chat.html">讨论组中的聊天交流</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../zh-cn/latest/contributing/donate.html">捐赠支持</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../zh-cn/latest/contributing/issue.html">有疑问或有问题和建议吗？</a></li>
</ul>
<p class="caption"><span class="caption-text">素材</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../zh-cn/latest/materials/posters.html">海报</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../zh-cn/latest/materials/x_days_to_sale.html">海报：KID 公开销售倒计时</a></li>
</ul>
<p class="caption"><span class="caption-text">政策</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../zh-cn/latest/policy/chatting_group.html">讨论组中的聊天交流</a></li>
</ul>
<p class="caption"><span class="caption-text">白皮书 v1.1.0</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../zh-cn/latest/whitepaper/background.html">背景</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../zh-cn/latest/whitepaper/keywords.html">关键词</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../zh-cn/latest/whitepaper/abbreviations.html">缩写</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../zh-cn/latest/whitepaper/summary.html">摘要</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../zh-cn/latest/whitepaper/philosophy.html">我们的哲学：对自由的向往</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../zh-cn/latest/whitepaper/design_principle.html">设计理念和设计原则</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../zh-cn/latest/whitepaper/application_description_and_economic_model.html">应用说明与经济模型</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../zh-cn/latest/whitepaper/technical_path.html">技术路径</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../zh-cn/latest/whitepaper/team.html">项目团队</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../zh-cn/latest/whitepaper/roadmap.html">路线图</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../zh-cn/latest/whitepaper/more.html">更多……</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../zh-cn/latest/whitepaper/token_and_distribution_plan.html">KID 与分配计划</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../zh-cn/latest/whitepaper/conclusion.html">结语</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../zh-cn/latest/whitepaper/special_tips.html">特别注意</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../zh-cn/latest/whitepaper/official_website.html">官方网站</a></li>
</ul>
<p class="caption"><span class="caption-text">联系我们</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../zh-cn/latest/contact_us.html">联系我们</a></li>
</ul>

            
          
        </div>
      <div id="rtd-grsig3zj" class="ethical-rtd ethical-dark-theme"></div></div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../../../zh-cn/latest/index.html">KID.network</a>
        
      </nav>


      <div class="wy-nav-content">
        
        <div class="rst-content style-external-links">
        
          















<div role="navigation" aria-label="breadcrumbs navigation">

  <ul class="wy-breadcrumbs">
    
      <li><a href="../../../zh-cn/latest/index.html">Docs</a> »</li>
        
      <li>KID 主合约</li>
    
    
      <li class="wy-breadcrumbs-aside">
        
            
            
              <a href="https://github.com/voken100g/docs/blob/master/contracts/voken.rst" class="fa fa-github"> Edit on GitHub</a>
            
          
        
      </li>
    
  </ul>

  
  <hr>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
  <div class="section" id="voken-main-contract">
<span id="voken-contract"></span><h1>KID 主合约<a class="headerlink" href="../../../zh-cn/latest/contracts/voken.html#voken-main-contract" title="永久链接至标题">¶</a></h1>
<p>这是 <a class="reference internal" href="../../../zh-cn/latest/whitepaper/application_description_and_economic_model.html#voken"><span class="std std-ref">流量币 KID —— 生态系统中的唯一通证</span></a> 的 <strong>主合约</strong> 。</p>
<p><a class="reference internal" href="all/etherscan_verified.svg"><img alt="logo_etherscan_verified" height="36px" src="all/etherscan_verified.svg" width="36px"></a> <a class="reference internal" href="all/github.svg"><img alt="logo_github" height="36px" src="all/github.svg" width="36px"></a> <a class="reference internal" href="all/verified.svg"><img alt="logo_verified" height="36px" src="all/verified.svg" width="36px"></a></p>
<ul class="simple">
<li>ENS 域名 <strong>voken100g.eth</strong></li>
<li>合约地址 <strong>0x82070415FEe803f94Ce5617Be1878503e58F0a6a</strong></li>
<li>部署于 <a class="reference external" href="https://etherscan.io/tx/0x9f173f8fc13a8efef7cb25b160c09958be03587b9b1af910bf8a9b3a48d68dc9">Tx Hash 0x9f173f8fc13a8efef7cb25b160c09958…</a></li>
<li>区块高度 <a class="reference external" href="https://etherscan.io/tx/0x9f173f8fc13a8efef7cb25b160c09958be03587b9b1af910bf8a9b3a48d68dc9">7635415</a></li>
<li>已经在 <a class="reference external" href="https://github.com/voken100g/contracts/blob/master/LICENSE">GNU 通用公区许可证 v3.0</a> 协议下开源</li>
<li><a class="reference external" href="https://github.com/voken100g/contracts/blob/master/KID.sol">查看合约代码在 github 仓库</a></li>
</ul>
<p>在 Etherscan.io 查看：</p>
<ul class="simple">
<li><a class="reference external" href="https://etherscan.io/token/0x82070415fee803f94ce5617be1878503e58f0a6a">KID 跟踪</a></li>
<li><a class="reference external" href="https://etherscan.io/token/0x82070415fee803f94ce5617be1878503e58f0a6a#readContract">通过 Etherscan.io 读取合约信息</a></li>
<li><a class="reference external" href="https://etherscan.io/token/0x82070415fee803f94ce5617be1878503e58f0a6a#writeContract">通过 Etherscan.io 操作合约</a></li>
</ul>
<p>相关链接：</p>
<ul class="simple">
<li><a class="reference internal" href="../../../zh-cn/latest/news/voken_contract_upgraded.html#voken-contract-upgraded"><span class="std std-ref">KID 主合约升级完毕</span></a></li>
</ul>
<div class="section" id="understand-voken-contract">
<h2>读懂 KID 合约<a class="headerlink" href="../../../zh-cn/latest/contracts/voken.html#understand-voken-contract" title="永久链接至标题">¶</a></h2>
<p>如果您想深入了解 KID 合约，这将帮助到您。</p>
<div class="section" id="meta">
<h3>元信息<a class="headerlink" href="../../../zh-cn/latest/contracts/voken.html#meta" title="永久链接至标题">¶</a></h3>
<div class="highlight-text notranslate"><div class="highlight"><pre><span></span>// solidity

string private _name = "KID.network 100G Token";
string private _symbol = "ABC";
uint8 private _decimals = 6;                // 6 decimals
uint256 private _cap = 35000000000000000;   // 35 billion
uint256 private _totalSupply;
</pre></div>
</div>
<dl class="docutils">
<dt>全名</dt>
<dd>KID.network 100G Token</dd>
<dt>字母简称</dt>
<dd>KID</dd>
<dt>小数位数</dt>
<dd>6</dd>
<dt>封顶的总供应量</dt>
<dd>350 亿</dd>
</dl>
</div>
<div class="section" id="voken-sale-whitelist-registration-trigger">
<h3>KID 销售白名单注册触发<a class="headerlink" href="../../../zh-cn/latest/contracts/voken.html#voken-sale-whitelist-registration-trigger" title="永久链接至标题">¶</a></h3>
<div class="highlight-text notranslate"><div class="highlight"><pre><span></span>// solidity

function transfer(address to, uint256 value) public whenNotPaused returns (bool) {
    if (_allowWhitelistRegistration &amp;&amp; value == _whitelistRegistrationValue
        &amp;&amp; inWhitelist(to) &amp;&amp; !inWhitelist(msg.sender) &amp;&amp; isNotContract(msg.sender)) {
        // Register whitelist for KID-Sale
        _regWhitelist(msg.sender, to);
        return true;
    } else {
        // Normal Transfer
        _transfer(msg.sender, to, value);
        return true;
    }
}
</pre></div>
</div>
<p><a class="reference internal" href="../../../zh-cn/latest/token/sale.html#voken-sale"><span class="std std-ref">KID 公开销售（5月27日启动）</span></a> 白名单注册的触发条件：</p>
<ul class="simple">
<li><code class="docutils literal notranslate"><span class="pre">_allowWhitelistRegistration</span></code> 是 <code class="docutils literal notranslate"><span class="pre">true</span></code>，即主合约处在可注册的状态。</li>
<li><code class="docutils literal notranslate"><span class="pre">value</span></code> = <code class="docutils literal notranslate"><span class="pre">_whitelistRegistrationValue</span></code> ，即转账数量是 1,001 KIDs 。</li>
<li><code class="docutils literal notranslate"><span class="pre">inWhitelist(to)</span></code> ，接收地址已经在白名单中。</li>
<li><code class="docutils literal notranslate"><span class="pre">!inWhitelist(msg.sender)</span></code> ，发送地址不在白名单中。</li>
<li><code class="docutils literal notranslate"><span class="pre">isNotContract(msg.sender)</span></code> ，发送地址不是合约，以避免任何来自合约转账的“巧合的意外”，包括“任何形式的批量转账”、“来自交易所的发送” 或其它任何形式的合约。</li>
</ul>
<p>除在此特殊条件下的转账，都被视为 <strong>普通转账</strong> 。</p>
</div>
<div class="section" id="voken-sale-whitelist-registration-and-referral-reward">
<h3>KID 销售白名单注册与转介奖励<a class="headerlink" href="../../../zh-cn/latest/contracts/voken.html#voken-sale-whitelist-registration-and-referral-reward" title="永久链接至标题">¶</a></h3>
<div class="highlight-text notranslate"><div class="highlight"><pre><span></span>// solidity

uint256 private _whitelistRegistrationValue = 1001000000;   // 1001 KID
uint256[15] private _whitelistRefRewards = [                // 100% Reward
    301000000,  // 301 KID for Level.1
    200000000,  // 200 KID for Level.2
    100000000,  // 100 KID for Level.3
    100000000,  // 100 KID for Level.4
    100000000,  // 100 KID for Level.5
    50000000,   //  50 KID for Level.6
    40000000,   //  40 KID for Level.7
    30000000,   //  30 KID for Level.8
    20000000,   //  20 KID for Level.9
    10000000,   //  10 KID for Level.10
    10000000,   //  10 KID for Level.11
    10000000,   //  10 KID for Level.12
    10000000,   //  10 KID for Level.13
    10000000,   //  10 KID for Level.14
    10000000    //  10 KID for Level.15
];
</pre></div>
</div>
<div class="highlight-text notranslate"><div class="highlight"><pre><span></span>// solidity

function _regWhitelist(address account, address refAccount) internal {
    _refCount[refAccount] = _refCount[refAccount].add(1);
    _referrer[account] = refAccount;

    emit KIDSaleWhitelistRegistered(account, refAccount);

    // Whitelist Registration Referral Reward
    _transfer(msg.sender, address(this), _whitelistRegistrationValue);
    address cur = account;
    uint256 remain = _whitelistRegistrationValue;
    for(uint i = 0; i &lt; _whitelistRefRewards.length; i++) {
        address rcv = _referrer[cur];
        if (cur != rcv) {
            if (_refCount[rcv] &gt; i) {
                _transfer(address(this), rcv, _whitelistRefRewards[i]);
                remain = remain.sub(_whitelistRefRewards[i]);
            }
        } else {
            _transfer(address(this), refAccount, remain);
            break;
        }
        cur = _referrer[cur];
    }
}
</pre></div>
</div>
<dl class="docutils">
<dt>转账 1,001 KIDs 到白名单中的地址</dt>
<dd>将触发 KID 销售白名单注册。</dd>
<dt>1,001 KIDs 的 100% 将用于发放奖励</dt>
<dd>最多 15 级：301 + 200 + 100 + …</dd>
</dl>
</div>
<div class="section" id="check-whether-a-eth-wallet-address-is-whitelisted">
<span id="check-address-in-whitelist"></span><h3>查看一个 ETH 钱包地址是否在白名单中<a class="headerlink" href="../../../zh-cn/latest/contracts/voken.html#check-whether-a-eth-wallet-address-is-whitelisted" title="永久链接至标题">¶</a></h3>
<div class="highlight-text notranslate"><div class="highlight"><pre><span></span>// solidity

function inWhitelist(address account) public view returns (bool) {
    return _referrer[account] != address(0);
}
</pre></div>
</div>
<dl class="docutils">
<dt>查看一个 ETH 钱包地址是否在白名单中</dt>
<dd>执行合约中的功能函数 <code class="docutils literal notranslate"><span class="pre">inWhitelist(address</span> <span class="pre">account)</span></code> ，如果给定的地址已在白名单中，则返回 <code class="docutils literal notranslate"><span class="pre">true</span></code> 。</dd>
</dl>
</div>
<div class="section" id="check-whether-the-voken-sale-whitelist-registration-is-in-process">
<h3>查看 KID 销售白名单注册是否还在进行中<a class="headerlink" href="../../../zh-cn/latest/contracts/voken.html#check-whether-the-voken-sale-whitelist-registration-is-in-process" title="永久链接至标题">¶</a></h3>
<div class="highlight-text notranslate"><div class="highlight"><pre><span></span>// solidity

function allowWhitelistRegistration() public view returns (bool) {
    return _allowWhitelistRegistration;
}
</pre></div>
</div>
<div class="highlight-text notranslate"><div class="highlight"><pre><span></span>// solidity

function disableKIDSaleWhitelistRegistration() external onlyOwner {
    _allowWhitelistRegistration = false;
    emit KIDSaleWhitelistRegistrationDisabled();
}
</pre></div>
</div>
<dl class="docutils">
<dt>查看 <a class="reference internal" href="../../../zh-cn/latest/token/sale.html#voken-sale"><span class="std std-ref">KID 公开销售（5月27日启动）</span></a> 白名单注册是否还在进行中</dt>
<dd><p class="first">执行合约中的功能函数 <code class="docutils literal notranslate"><span class="pre">allowWhitelistRegistration()</span></code> ，如果返回 <code class="docutils literal notranslate"><span class="pre">true</span></code> 说明注册是被允许的。</p>
<p class="last">一旦返回 <code class="docutils literal notranslate"><span class="pre">false</span></code> 就意味着白名单注册已经关闭，并且不可逆。</p>
</dd>
</dl>
</div>
<div class="section" id="whitelist-qualification-transfer-is-supported">
<span id="whitelist-transfer-whitelist-qualification"></span><h3>白名单资格支持过户<a class="headerlink" href="../../../zh-cn/latest/contracts/voken.html#whitelist-qualification-transfer-is-supported" title="永久链接至标题">¶</a></h3>
<div class="highlight-text notranslate"><div class="highlight"><pre><span></span>// solidity

function transferWhitelist(address account) external onlyInWhitelist {
    require(isNotContract(account));
    _refCount[account] = _refCount[msg.sender];
    _refCount[msg.sender] = 0;
    _referrer[account] = _referrer[msg.sender];
    _referrer[msg.sender] = address(0);
    emit KIDSaleWhitelistTransferred(msg.sender, account);
}
</pre></div>
</div>
<dl class="docutils">
<dt>白名单资格支持过户</dt>
<dd>只需执行合约中的功能函数 <code class="docutils literal notranslate"><span class="pre">transferWhitelist(address</span> <span class="pre">account)</span></code> ，如果你需要。</dd>
</dl>
</div>
</div>
</div>


           </div>
           
          </div>
          <footer>
  
    <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
      
        <a href="../../../zh-cn/latest/contracts/voken_sale.html" class="btn btn-neutral float-right" title="KID 公开销售合约" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
      
      
        <a href="../../../zh-cn/latest/views/basic_principles.html" class="btn btn-neutral float-left" title="基础原则" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
      
    </div>
  

  <hr><div><div id="rtd-48wrq9aqg" class="ethical-rtd"></div></div>

  <div role="contentinfo">
    <p>
        © Copyright 2017-2019, KID Project
      
        <span class="commit">
          Revision <code>0490170f</code>.
        </span>
      

    </p>
  </div>
  Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org/">Read the Docs</a>. 

</footer>

        </div>
      </div>

    </section>

  </div>
  

  <div class="rst-versions shift" data-toggle="rst-versions" role="note" aria-label="versions">
    <span class="rst-current-version" data-toggle="rst-current-version">
      <span class="fa fa-book"> Read the Docs</span>
      v: latest
      <span class="fa fa-caret-down"></span>
    </span>
    <div class="rst-other-versions">
      <dl>
        <dt>Versions</dt>
        
          <dd><a href="../../../zh-cn/latest/">latest</a></dd>
        
      </dl>
      <dl>
        <dt>Downloads</dt>
        
          <dd><a href="https://readthedocs.org/projects/voken-simplified-chinese/downloads/htmlzip/latest/">html</a></dd>
        
          <dd><a href="https://readthedocs.org/projects/voken-simplified-chinese/downloads/epub/latest/">epub</a></dd>
        
      </dl>
      <dl>
        <dt>On Read the Docs</dt>
          <dd>
            <a href="https://readthedocs.org/projects/voken-simplified-chinese/?fromdocs=voken-simplified-chinese">Project Home</a>
          </dd>
          <dd>
            <a href="https://readthedocs.org/builds/voken-simplified-chinese/?fromdocs=voken-simplified-chinese">Builds</a>
          </dd>
      </dl>
      <hr>
      Free document hosting provided by <a href="http://www.readthedocs.org/">Read the Docs</a>.

    </div>
  </div>



  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script>

  
   


<div id="rtd-goyafkhrf"></div></body></html>
